package cup.league.app;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class HomeActivity extends Activity {
	
	private Button loadLastChamp;
	private Button loadChamp;
	private Button newChamp;
	private Button manageChamps;
	private Button registerTeams;
		
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.home);

        newChamp = (Button) findViewById(R.id.newChamp);
        newChamp.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				launchNewChampAct();
				
			}
		});
        
        registerTeams = (Button) findViewById(R.id.registerTeams);
        registerTeams.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				launchRegisterTeamsAct();
				
			}
		});
        
        loadChamp = (Button) findViewById(R.id.loadChamp);
        loadChamp.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				launchLoadChampsAct();
				
			}
		});
        
    }
    
    protected void launchLoadChampsAct() {
    	Intent loadChamp = new Intent(this, LoadChampsActivity.class);
    	startActivity(loadChamp);
		
	}

	private void launchRegisterTeamsAct() {
    	Intent regTeams = new Intent(this, RegisterTeamsActivity.class);
    	regTeams.putExtra("numPart", -1);
    	startActivity(regTeams);
		
	}

	private void launchNewChampAct(){
    	Intent newChampView = new Intent(this, NewChampActivity.class);
    	startActivity(newChampView);
    }
    
    }